<?php
	/* Function for page layout */

	require_once("config.php");
	if(isset($_SESSION['lang'])) {
		require_once("include/lang." . $_SESSION['lang'] . ".php");
	}
	else {
		require_once("include/lang." . LANG . ".php");
	}

	function html_start() {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<title>XaBook</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="author" content="Martin Mortensen" />
		<meta name="title" content="AddressBook v.0.1 alpha" />
		<meta name="keywords" content="addressbook, address, book, opensource" />
		<link rel="stylesheet" href="css/layout.css" media="all" type="text/css" />
		<script type="text/javascript" src="js/res.js"></script>
	</head>
	<body>

		<div id="top">
			<div id="ver">&nbsp;XaBook - Address Book</div>
		</div>

			<div id="menu">
				<div id="nav">
					<span class="conin">
						<?php
							if($_SESSION['login'] == 1 && $_SESSION['sessionid'] == session_id()) {
								print "<img src=\"img/head.gif\" alt=\"\" /> " . $_SESSION['user'] . "<br />\n";
								if($_SESSION['priv'] >= 1) {
									print "<a href=\"home.php\">" . MENU_CONTACTS . "</a><br />\n";
								}
								if($_SESSION['priv'] >= 2) {
									print "<a href=\"contact.php\">" . MENU_ADD . "</a><br />\n";
print "<a href=\"phoneralternate.php\">" ."Make Call". "</a><br />\n";
print "<a href=\"smseralternate.php\">" ."Send SMS". "</a><br />\n";

								}
								if($_SESSION['priv'] == 3) {
									print "<a href=\"groups.php\">" . MENU_GROUPS . "</a><br />\n";
									print "<a href=\"users.php\">" . MENU_USERS . "</a><br />\n";
								}
								print "<a href=\"logout.php\">" . MENU_LOGOUT . "</a>\n";
									
							}
							else {
								print LANG_WELCOME;
							}
						?>
					</span>
				</div>
			</div>

		<div id="content">
<?php
	}

	function html_end() {
?>
		</div>
	</body>
</html>
<?php
	}
?>
